import { BrowserWindow, ipcMain, dialog, shell } from 'electron'
import fs from 'fs-extra'
import path from 'path'

export const bindFileHandleEvent = ({ mainWindow }) => {
  // 选择打开本地文件
  ipcMain.handle('selectOpenFile', (event, options) => {
    const res = dialog.showOpenDialogSync(options)
    if (res && res[0]) {
      return res[0]
    }
    return null
  })
}
